// function login(){
// 	var windowWidth=$(window).width();
// 	$('.top,.middle,.foot').css({opacity:'0.5'});
// 	if(windowWidth>800){
// 		$('.login_box').css({left:windowWidth/2-240,display:'block',opacity:'1'});
// 	}else{
// 		$('.login_box').css({left:windowWidth/2-158,display:'block',opacity:'1'});
// 	}			
// }
// --------------------------------验证码刷新-------------------//
function verifyingNew(){
	var verifying = $(check_img).attr("src");
	if(verifying.indexOf('?')>0){
		$(check_img).attr("src",verifying+'&random='+Math.random());
	}else{
		$(check_img).attr("src",verifying.replace(/\?.*$/,'')+'?'+Math.random());
	}
}	

function close_login(){
	$('.top,.middle,.foot').css({opacity:'1'});
	$('.login_box').css({display:'none'});
	$('.check_error').css({display:'none'});
	$('.login_error').css({display:'none'});
}

// --------------------获取cookie--------------------//
function getCookie(c_name)
{
	if (document.cookie.length>0)
  	{
  		c_start=document.cookie.indexOf(c_name + "=");
  		if (c_start!=-1)
    	{ 
    		c_start=c_start + c_name.length+1;
    		c_end=document.cookie.indexOf(";",c_start);
    		if (c_end==-1)
    		{
    			c_end=document.cookie.length;
    		}
    		return unescape(document.cookie.substring(c_start,c_end));
    	} 
  	}
	return "";
}
function setCookie(c_name,v_name){
  var expdate=new Date();
  expdate.setTime(expdate.getTime() + 2 * 24 * 60 * 60 * 1000); 
  document.cookie = c_name+"="+v_name+";expires="+expdate.toGMTString()+";path=/";
  queryObject.remove('a');
}
// --------------------注销--------------------//
function logout(){
	var cookies = document.cookie.split(";");
    for (var i = 0; i < cookies.length; i++) {
    	var cookie = cookies[i];
    	var eqPos = cookie.indexOf("=");
    	var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
    	document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/";
    }
	if(cookies.length > 0)
	{
   		 for (var i = 0; i < cookies.length; i++) {
    		var cookie = cookies[i];
    		var eqPos = cookie.indexOf("=");
    		var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
			var domain = location.host.substr(location.host.indexOf('.'));
    		document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=" + domain;
   		 }
	}
	location.reload(true);
}
function GetQueryString(name)
{
     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
     var r = window.location.search.substr(1).match(reg);
     if(r!=null)return  unescape(r[2]); return null;
}